@extends('Home.User.Common.layout')
@section('title')
    人员信息_人事管理
@endsection
@section('content')
    <!--  content  -->
    <main class="common_content">
        <div class="container">
            <div class="ct_main">
                @include('Home.User.Hr.Common.hr_menu')
                <ul class="nav-items1 nav-items2 w999" id="tab-content2">
                    <!--人员信息-->
                    <li class="basic-sets active">
                        <form class="selector-head layui-form" method="post" action="{{route('hr_person')}}">
                            @csrf
                            <h2>人员信息</h2>
                            <div class="rt">
                                @if (Auth::user()->hasAnyRole(['admin','leader']))
                                    <div class="layui-input-inline" style="width: 150px;margin-right: 2px;vertical-align: unset;">
                                        <select name="uid" lay-search>
                                            <option value="0" @if(0 == $uid) selected @endif>全员</option>
                                            @foreach($user as $item)
                                                <option value="{{$item->id}}" @if($item->id == $uid) selected @endif>{{$item->username}}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                    <button class="layui-btn layui-btn-sm" lay-submit lay-filter="formSub"><i class="icon icon-search"></i></button>
                                @endif
                                @if (Auth::user()->hasRole('admin'))
                                    <a href="javacsript:;" class="add-new-btn" title="添加员工" onclick="open_button('{{route('person_add')}}','添加员工')"><i class="icon icon-xinzen"></i></a>
                                @endif
                            </div>
                        </form>
                        <div class="layui-form basic-sets-ul">
                            <table class="layui-table">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>姓名</th>
                                    <th>性别</th>
                                    <th>生日</th>
                                    <th>籍贯</th>
                                    {{--<th>身份证号</th>--}}
                                    <th>毕业时间</th>
                                    {{--<th>学历</th>--}}
                                    {{--<th>专业</th>--}}
                                    <th>电话</th>
                                    <th>邮箱</th>
                                    <th>微信</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $item)
                                    <tr>
                                        <td data-label="ID" title="{{$item->id}}"> {{$item->id}}</td>
                                        <td data-label="姓名" title="{{$item->username}}">{{$item->username}}</td>
                                        <td data-label="性别" title="{{$item->sex_name}}">{{$item->sex_name}}</td>
                                        <td data-label="生日" title="{{$item->birthday}}">{{$item->birthday}}</td>
                                        <td data-label="籍贯" title="{{$item->native}}">{{$item->native}}</td>
                                        {{--<td data-label="身份证号" title="{{$item->card_id}}">{{$item->card_id}}</td>--}}
                                        <td data-label="毕业时间" title="{{$item->graduation_time}}">{{$item->graduation_time}}</td>
                                        {{--<td data-label="学历" title="{{$item->education_name}}">{{$item->education_name}}</td>--}}
                                        {{--<td data-label="专业" title="{{$item->major}}">{{$item->major}}</td>--}}
                                        <td data-label="电话" title="{{$item->phone}}">{{$item->phone}}</td>
                                        <td data-label="邮箱" title="{{$item->email}}">{{$item->email}}</td>
                                        <td data-label="微信" title="{{$item->wechat}}">{{$item->wechat}}</td>
                                        <td data-label="操作" class="tac layui-row layui-col-space10">
                                            <a href="javascript:;" class="edit-btn edit-client" onclick="open_button('{{route('person_edit',$item->id)}}','查看')" title="查看"><i class="layui-icon">&#xe642;</i></a>
                                            {{--<a href="javascript:;" class="edit-btn edit-client" onclick="open_button('{{route('hr_promotion',$item->id)}}','升职加薪记录')" title="升职加薪记录"><i class="layui-icon">&#xe60e;</i></a>--}}
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </main>
@endsection